﻿using System;
using System.Collections.Generic;
using NetBay.Core.BusinessEntities;
using NetBay.Core.Log;
using Rio.Manager.Business.Repository.Translator;
using NetBay.Core.BusinessEntities.DashBoard;
using Rio.Manager.DataAccess;

namespace Rio.Framework.Business.Repository
{
    public class DashBoardRepository
    {
        /// <summary>
        /// Get numerization resum by operator
        /// </summary>
        /// <param name="StartDate">Starting Date</param>
        /// <param name="EndDate">endingDate</param>
        /// <returns></returns>
        public static List<NumerizationOperator> GetNumerizationReportByOperator(DateTime StartDate, DateTime EndDate)
        {
            var l_oRet = new List<NumerizationOperator>();
            try
            {
                l_oRet = DashBoardTranslator.GetNumerizationReportByOperator(DA_DashBoard.GetNumerizationReportByOperator(StartDate, EndDate));
            }
            catch (Exception ex)
            {
                LogManager.Instance().LogError(ex.Message);
            }
            return l_oRet;
        }

        /// <summary>
        /// Get global numerization resum
        /// </summary>
        /// <param name="StartDate">Starting Date</param>
        /// <param name="EndDate">endingDate</param>
        /// <returns></returns>
        public static NumerizationResum GetNumerizationReport(DateTime StartDate, DateTime EndDate)
        {
            var l_oRet = new NumerizationResum();
            try
            {
                l_oRet = DashBoardTranslator.GetNumerizationReport(DA_DashBoard.GetNumerizationReport(StartDate, EndDate));
            }
            catch (Exception ex)
            {
                LogManager.Instance().LogError(ex.Message);
            }
            return l_oRet;
        }
    }
}